package com.example.fsd.controller.configmap;

import com.example.fsd.common.result.R;
import com.example.fsd.pojo.ConfigMap;
import com.example.fsd.pojo.Configs;
import com.example.fsd.service.configmap.IConfigMapService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2024-12-10
 */
@RestController
@RequestMapping("/configMap")
@RequiredArgsConstructor
public class ConfigMapController {
    private final IConfigMapService configMapService;
    //获取configMap列表
    @GetMapping("/list")
    public R list() {
     return configMapService.getConfigMapList();
    }

    @PostMapping("/updateConfigsLogo")
    private R updateConfigsLogo(MultipartFile logo){
        return configMapService.updateConfigsLogo(logo);
    }

    @PostMapping("/updateConfigs")
    private R updateConfigs(@RequestBody ConfigMap configMap){
        return configMapService.updateConfigMap(configMap);
    }

    @PostMapping("/upadaetConfigMapPic")
    private R upadaetConfigMapPic(MultipartFile file,Long id){
        return configMapService.upadaetConfigMapPic(file,id);
    }
}
